function Get-ServerCredential {
    [CmdletBinding()]
    [OutputType('PSCredential')]
    param (
        [Parameter(Mandatory = $true)][string]$Message,
        [Parameter(Mandatory = $false)][string]$UserName,
        [Parameter(Mandatory = $false)][switch]$Confirm,
        [Parameter(Mandatory = $false)][string[]]$Blocklist
    )
    
    # Allow user to use existing value or to update it.
    if (!(Confirm-SingleValue -Description 'Server user name' -Value $UserName)) {
        $UserName = $null
    }

    # Ask user.
    Write-Host # Newline.
    $regex = (Read-Config).Regex.AzureSQLPassword
 
    return Get-LSNewCredential -Message $Message -UserName $UserName -Confirm:$Confirm -Blocklist $Blocklist -Regex $regex   
}